<?php

use yii\db\Schema;
use yii\db\Migration;

class m160629_094631_update_mobile_app_category extends Migration
{
    public function up()
    {
        $sql = <<<FINE
            update {{%mobile_app_category}} set pid = 0, name = '饮食' where category_id = 164;
            insert into {{%mobile_app_category}} (ad_network_id, category_id, pid, market, market_id, category, name) values 
                                                 (1, 165, 0, '2', '60571', 'Shopping', '购物') ,
                                                 (1, 166, 164, '2', '60570', 'Food & Drink', '饮食') ,
                                                 (1, 167, 165, '2', '60571', 'Shopping', '购物');
FINE;
        return $this->execute($sql);
    }

    public function down()
    {
        return true;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}
